package org.wyz.mapreduce.pagerank;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class PageWritable implements Writable {

    public String content;
    public int tag; // 0表示是个入度节点，1表示原来的结构

    public PageWritable(String content, int tag) {
        this.content = content;
        this.tag = tag;
    }

    public PageWritable() {
    }


    @Override
    public void write(DataOutput out) throws IOException {
        out.writeUTF(content);
        out.writeInt(tag);
    }

    @Override
    public void readFields(DataInput in) throws IOException {
        content = in.readUTF();
        tag = in.readInt();
    }
}
